Masala #0136
Yo'l
n × n o’lchamli jadvalda (x0, y0) katakdan (x1, y1) ga nechi xil usulda borish mumkin? Masalan ushbu rasmda (1, 2) dan (3, 3) ga boruvchi yo’l tasvirlangan.
LDRDLDRRRUUULDD
LDRRURDDDLLLURR (Rasmdagi yo’l)
LDDDRRRUUULDLDR
LDDDRUURURDDDLU
Yo’l har bir katakdan aynan bir marta o’tishi shart.
Birinchi qatorda n natural son. (2 ≤ n ≤ 5).
Ikkinchi qatorda x0 va y0 (1 ≤ x0, y0 ≤ n).
Uchinchi qatorda x1 va y1 (1 ≤ x1, y1 ≤ n).
Bitta qatorda (x0, y0) dan (x1, y1) ga necha xil usulda borish mumkinligini chiqaring.
# | input.txt | output.txt |
---|---|---|
1 |
4 1 2 3 3 |
4 |